﻿@model HQPad.Models.SpellListModel

<h2>Spells</h2>

@if (Model.Spells.Count > 0)
{
<table class="spells-list">
    <thead>
        <th>Colour</th>
        <th>Name</th>
        <th class="centred">Level</th>
        <th class="centred">Known</th>
        <th class="centred">Attuned</th>
    </thead>
    <tbody>
        @foreach (var spell in Model.Spells)
        {
            <tr @Html.Raw("class='" + spell.Colour.ToLower() + "-spell" + ((spell.Selected) ? " spell-known" : "") + "'") @Html.Raw("data-group-name='" + spell.Group + "'") @Html.Raw("data-colour='" + spell.Colour.ToLower() + "'") @Html.Raw("data-is-system='" + spell.SystemSpell.ToString().ToLower() + "'") @Html.Raw("data-type='" + Enum.GetName(typeof(HQPad.Helpers.SchoolStatusAssignmentType), spell.AssignmentType).ToLower().ToLower() + "'") >
                <td class="spell-colour">@Html.Raw(spell.Colour)</td>
                <td>@Html.Raw(spell.Name)</td>
                <td class="centred">@Html.Raw(spell.Level)</td>
                <td class="centred">@Html.CheckBox(string.Format("spell_known_{0}", spell.Group), spell.Selected, new { @class = "spell-selected" })</td>
                <td class="centred">@Html.CheckBox(string.Format("spell_attuned_{0}", spell.Group), spell.Attuned, new { @class = "spell-attuned" })</td>
            </tr>
        }
    </tbody>
</table>
}
else
{
    <p>There are no available spells.</p>
}